﻿
@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Wap/Views/Shared/_Layout.cshtml";
}
<link href="/Areas/Wap/Content/Products.css" rel="stylesheet" />
@model IQueryable<YTCMS.Domain.Entities.products>
@using YTCMS.Core

<div id="wrap" class="clearfix overflow mg-auto">
    <div class="i-head mg-auto overflow area border-bom">
        <h1>
            @*西藏
            <span>集结号</span>*@
            @ViewBag.cname
        </h1>
    </div>
    <!--特惠推荐--->
    <div class="push">
        <div class="favorable">
            <div class="push_title">
                <span>
                    特惠推荐
                </span>
            </div>
            <div class="push_body">
                <ul>
                   

                    @{
                        if (Model.Any())
                        {
                            foreach (var item in Model.Where(s=>s.IsPush ==1).Take(3))
                            {
                                 <li>
                                    <div>
                                        <a href="/Wap/products/details?id=@item.Id"> <img src="@item.Image.Replace("_120x120.jpg", "_194x124.jpg")" style="width:194px; height:124px;" /></a>
                                        <span><a href="/wap/products/details?id=@item.Id" title="@item.Name">@item.Name.GetSubString(7,"")</a></span>
                                        <span>￥@item.Price 起</span>
                                    </div>
                                </li>
                            }
                        }
                    }
                   
                    @*<li>
                        <div>
                            <img src="/Areas/Wap/Content/img/favorable.jpg" />
                            <span><a href="">拉萨6日游</a> </span>
                            <span>￥1288 起</span>
                        </div>
                    </li>
                    <li>
                        <div>
                            <img src="/Areas/Wap/Content/img/favorable.jpg" />
                            <span><a href="">拉萨6日游</a> </span>
                            <span>￥1288 起</span>
                        </div>
                    </li>*@
                </ul>
            </div>
        </div>
        <!---热门线路-->
        <div class="hotline">
            <div class="hotline_title">
                <span>
                    热门线路
                </span>
            </div>
            <div class="hotline_body" id="hotline">
                @{
                        if (Model.Any())
                        {
                            foreach (var item in Model.Take(6))
                            {
                                <div class="item">
                                    <div class="hotline_body_left">
                                        <a href="/Wap/products/details?id=@item.Id"> <img src="@item.Image.Replace("_120x120.jpg", "_194x124.jpg")" style="width:198px; height:105px;" /></a>
                                    </div>
                                    <div class="hotline_body_right">
                                        <div class="title"><a href="/wap/products/details?id=@item.Id">@item.Name</a></div>
                                        <div class="time"><span>最近期团:</span>@(string.IsNullOrEmpty(item.Latest) ? "暂无" : item.Latest)</div>
                                        <div class="price">￥@item.Price 起</div>
                                    </div>
                                </div>
                            }
                        }
                    
                        
                    }




                @*<div class="item">
                    <div class="hotline_body_left">
                        <img src="/Areas/Wap/Content/img/h1.jpg" />
                    </div>
                    <div class="hotline_body_right">
                        <div class="title"><a>拉萨布达拉宫双日游</a></div>
                        <div class="time"><span>最近期团</span>2-17 </div>
                        <div class="price">￥1288 起</div>
                    </div>
                </div>
                <div class="item">
                    <div class="hotline_body_left">
                        <img src="/Areas/Wap/Content/img/h1.jpg" />
                    </div>
                    <div class="hotline_body_right">
                        <div class="title"><a>拉萨布达拉宫双日游</a></div>
                        <div class="time"><span>最近期团</span>2-17 </div>
                        <div class="price">￥1288 起</div>
                    </div>
                </div>
                <div class="item">
                    <div class="hotline_body_left">
                        <img src="/Areas/Wap/Content/img/h1.jpg" />
                    </div>
                    <div class="hotline_body_right">
                        <div class="title"><a>拉萨布达拉宫双日游</a></div>
                        <div class="time"><span>最近期团</span>2-17 </div>
                        <div class="price">￥1288 起</div>
                    </div>
                </div>
                <div class="item">
                    <div class="hotline_body_left">
                        <img src="/Areas/Wap/Content/img/h1.jpg" />
                    </div>
                    <div class="hotline_body_right">
                        <div class="title"><a>拉萨布达拉宫双日游</a></div>
                        <div class="time"><span>最近期团</span>2-17 </div>
                        <div class="price">￥1288 起</div>
                    </div>
                </div>
                <div class="item">
                    <div class="hotline_body_left">
                        <img src="/Areas/Wap/Content/img/h1.jpg" />
                    </div>
                    <div class="hotline_body_right">
                        <div class="title"><a>拉萨布达拉宫双日游</a></div>
                        <div class="time"><span>最近期团</span>2-17 </div>
                        <div class="price">￥1288 起</div>
                    </div>
                </div>*@
            </div>
            <div class="hotline_bottom" id="Add">
                <span>点击加载更多</span>
            </div>
        </div>

        <!--底部--->
        <div class="bottom">
            <span><a rel="external" href="tel://02388721881" data-role="none">国内热线：023-8872 1881(点击拨打)</a></span>
            <span><a rel="external" href="tel://02388721886" data-role="none">出境热线：023-8872 1886(点击拨打)</a></span>
            <span> Copyright © 西藏集结号旅游服务有限公司</span>
        </div>
    </div>

    <div class="top_bar footer_bar">
        <nav>
            <ul class="top_menu">
                <li>
                    <a href="/wap/Home/Index">
                        <img src="/Areas/Wap/Content/img/home.png" />
                        首页
                    </a>
                </li>
                <li>
                    <img src="/Areas/Wap/Content/img/consult.png" />
                    点击咨询
                </li>
            </ul>
        </nav>
    </div>
</div>

<script>
    $("#Add").click(function () {
        var top = 0
        $(".item").each(function () {
            top++;
        })
        var cid = $("#cid").val();
        if (parseInt(top) >= 6) {
            $.post('/wap/Products/Add', { cid: cid, top: top }, function (result) {
                $(".item:last").after(result);
            })
        }
    });
</script>